package com.hncboy.chatgpt.base.domain.mongodb;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.jetbrains.annotations.NotNull;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;

import java.io.Serializable;
import java.util.Date;

@Data
@Setter
@Getter
@Accessors(chain = true)
@Document(collection = "verification_code")
public class VerificationCode implements Serializable {

    @Indexed
    @Field(value = "id", targetType = FieldType.STRING)
    public String id;

    @Indexed
    @Field(value = "email", targetType = FieldType.STRING)
    public String email;

    @Field(value = "context", targetType = FieldType.STRING)
    public String context;

    @Field(value = "status", targetType = FieldType.BOOLEAN)
    public boolean status;

    @Field(value = "begin", targetType = FieldType.DATE_TIME)
    public Date begin;

    @Field(value = "end", targetType = FieldType.DATE_TIME)
    public Date end;

    @Field(value = "create_date", targetType = FieldType.DATE_TIME)
    public Date createDate;

}
